package me.magicall.db.springjdbc;

import java.util.HashMap;
import java.util.Map;

import me.magicall.db.meta.TableMeta;
import me.magicall.db.meta.TableMetaAccessor;

import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;

public class MapDao extends UsingTableMetaDao<Map<String, Object>> {

	public MapDao(final TableMeta tableMeta, final NamedParameterJdbcOperations jdbc, final TableMetaAccessor tableMetaAccessor) {
		super(tableMeta, jdbc, tableMetaAccessor);
	}

	@Override
	protected Object getProperty(final Map<String, Object> model, final String fieldName) {
		return model.get(fieldName);
	}

	@Override
	protected void setProperty(final Map<String, Object> model, final String fieldName, final Object value) {
		model.put(fieldName, value);
	}

	@Override
	protected Map<String, Object> newT() {
		return new HashMap<String, Object>();
	}
}
